package com.lsa.letcode.the153.minInRotatedArrNoDupl;

import static org.junit.Assert.*;

import org.junit.Test;

public class MinInRotatedArrNoDuplTest {

	@Test
	public void test() {
		test(new int[] { 3, 1 }, 1);
		test(new int[] { 1 }, 1);
		test(new int[] { 1, 2, 3, 4, 5, 6, 7, }, 1);
		test(new int[] { 6, 1, 2, 3, 4, 5 }, 1);
		test(new int[] { 6, 7, 1, 2, 3, 4, 5 }, 1);
		test(new int[] { 5, 6, 7, 1, 2, 3, 4 }, 1);
		test(new int[] { 4, 5, 6, 7, 1, 2, 3 }, 1);
		test(new int[] { 3, 4, 5, 6, 7, 1, 2 }, 1);
		test(new int[] { 2, 3, 4, 5, 6, 7, 1 }, 1);
	}

	private void test(int[] arr, int e) {
		Solution s = new Solution();
		assertEquals(e, s.findMin(arr));
	}
}
